<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('质保金充值')" />
</head>
<body>
    <div class="main-content">
        <form id="form-factory-add" class="form-horizontal">
            <input id="factoryId" name="id" th:value="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label ">审核意见：</label>
                <div class="col-sm-8">
                    <textarea id="rejectionReason" autocomplete="off" name="rejectionReason" placeholder="请输入审核意见" rows="6" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <div style="width:100%;text-align:center">
        <button type="submit" style="margin-right: 100px;width: 100px;" class="btn btn-sm btn-primary"  onclick="submitHandler()"><i class="fa fa-check"></i>通过</button>
        <button type="button" style="width: 100px" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>驳回</button>
    </div>
	<th:block th:include="include :: footer" />
    <script type="text/javascript">
        function submitHandler() {
        	if ($.validate.form()) {
                var data = { "rejectionReason": $("#rejectionReason").val(),"id":$("#factoryId").val(),"type":"1" };
                $.operate.submit(ctx + "zsyh/factory/reviewFactory", "post", "json", data,function () {
                    parent.$("#bootstrap-table").bootstrapTable('refresh',{});
                });
                $.modal.close();

            }
        }


        function closeItem() {
            if ($.validate.form()) {
                var data = { "rejectionReason": $("#rejectionReason").val(),"id":$("#factoryId").val(),"type":"-1" };
                $.operate.submit(ctx + "zsyh/factory/reviewFactory", "post", "json", data,function () {
                    parent.$("#bootstrap-table").bootstrapTable('refresh',{});
                });
                $.modal.close();

            }
        }
    </script>
</body>
</html>
